package com.str.intro;
import java.io.*;

public class DateTest {

  public static void main(String[] args) throws IOException {
    BufferedReader stdin = new BufferedReader(
        new InputStreamReader(System.in));

    System.out.print("Enter the year: ");
    String inputLine = stdin.readLine();
    int y = Integer.parseInt(inputLine);

    System.out.print("Enter the month: ");
    inputLine = stdin.readLine();
    int m = Integer.parseInt(inputLine);

    System.out.print("Enter the day of the month: ");
    inputLine = stdin.readLine();
    int d = Integer.parseInt(inputLine);

    Date toDay = new Date1(y, m, d);
    // Date toDay = new Date2(y, m, d);
    System.out.println(toDay);

    System.out.print("Enter advance day number: ");
    inputLine = stdin.readLine();
    int ad = Integer.parseInt(inputLine);

    if (ad >= 0) toDay.advance(ad);
    System.out.println(toDay);
  }
} // end class DateTest
